home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gsccode.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  4.3 KB  |  122 lines

  1. /* Copyright (C) 1993, 2000 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: gsccode.h,v 1.4 2000/09/19 19:00:26 lpd Exp $ */
  20. /* Types for character codes */
  21.  
  22. #ifndef gsccode_INCLUDED
  23. #  define gsccode_INCLUDED
  24.  
  25. /*
  26.  * Define a character code.  Normally this is just a single byte from a
  27.  * string, but because of composite fonts, character codes must be
  28.  * at least 32 bits.
  29.  */
  30. typedef ulong gs_char;
  31.  
  32. #define gs_no_char ((gs_char)~0L)
  33.  
  34. /*
  35.  * Define a character glyph code, a.k.a. character name.
  36.  * gs_glyphs from 0 to 2^31-1 are (PostScript) names; gs_glyphs 2^31 and
  37.  * above are CIDs, biased by 2^31.
  38.  */
  39. typedef ulong gs_glyph;
  40.  
  41. #define gs_no_glyph ((gs_glyph)0x7fffffff)
  42. #if arch_sizeof_long > 4
  43. #  define gs_min_cid_glyph ((gs_glyph)0x80000000L)
  44. #else
  45. /* Avoid compiler warnings about signed/unsigned constants. */
  46. #  define gs_min_cid_glyph ((gs_glyph)~0x7fffffff)
  47. #endif
  48. #define gs_max_glyph max_ulong
  49.  
  50. /* Define a procedure for marking a gs_glyph during garbage collection. */
  51. typedef bool(*gs_glyph_mark_proc_t) (P2(gs_glyph glyph, void *proc_data));
  52.  
  53. /* Define a procedure for mapping a gs_glyph to its (string) name. */
  54. /*
  55.  * NOTE: As of release 6.21, his procedure is obsolete and deprecated,
  56.  * but it must be supported for backward compatibility for the xfont
  57.  * interface.
  58.  */
  59. #define gs_proc_glyph_name(proc)\
  60.   const char *proc(P2(gs_glyph, uint *))
  61. typedef gs_proc_glyph_name((*gs_proc_glyph_name_t));
  62. /*
  63.  * This is the updated procedure, which accepts closure data and also can
  64.  * return an error code.
  65.  */
  66. #define gs_glyph_name_proc(proc)\
  67.   int proc(P3(gs_glyph glyph, gs_const_string *pstr, void *proc_data))
  68. typedef gs_glyph_name_proc((*gs_glyph_name_proc_t));
  69.  
  70. /* Define the indices for known encodings. */
  71. typedef enum {
  72.     ENCODING_INDEX_UNKNOWN = -1,
  73.     /* Real encodings.  These must come first. */
  74.     ENCODING_INDEX_STANDARD = 0,
  75.     ENCODING_INDEX_ISOLATIN1,
  76.     ENCODING_INDEX_SYMBOL,
  77.     ENCODING_INDEX_DINGBATS,
  78.     ENCODING_INDEX_WINANSI,
  79.     ENCODING_INDEX_MACROMAN,
  80.     ENCODING_INDEX_MACEXPERT,
  81. #define NUM_KNOWN_REAL_ENCODINGS 7
  82.     /* Pseudo-encodings (glyph sets). */
  83.     ENCODING_INDEX_MACGLYPH,    /* Mac glyphs */
  84.     ENCODING_INDEX_ALOGLYPH,    /* Adobe Latin glyph set */
  85.     ENCODING_INDEX_ALXGLYPH,    /* Adobe Latin Extended glyph set */
  86.     ENCODING_INDEX_CFFSTRINGS    /* CFF StandardStrings */
  87. #define NUM_KNOWN_ENCODINGS 11
  88. } gs_encoding_index_t;
  89. #define KNOWN_REAL_ENCODING_NAMES\
  90.   "StandardEncoding", "ISOLatin1Encoding", "SymbolEncoding",\
  91.   "DingbatsEncoding", "WinAnsiEncoding", "MacRomanEncoding",\
  92.   "MacExpertEncoding"
  93.  
  94. /*
  95.  * For fonts that use more than one method to identify glyphs, define the
  96.  * glyph space for the values returned by procedures that return glyphs.
  97.  * Note that if a font uses only one method (such as Type 1 fonts, which
  98.  * only use names, or TrueType fonts, which only use indexes), the
  99.  * glyph_space argument is ignored.
  100.  */
  101. typedef enum gs_glyph_space_s {
  102.     GLYPH_SPACE_NAME,        /* names (if available) */
  103.     GLYPH_SPACE_INDEX        /* indexes (if available) */
  104. } gs_glyph_space_t;
  105.  
  106. /*
  107.  * Define a procedure for accessing the known encodings.  Note that if
  108.  * there is a choice, this procedure always returns a glyph name, not a
  109.  * glyph index.
  110.  */
  111. #define gs_proc_known_encode(proc)\
  112.   gs_glyph proc(P2(gs_char, int))
  113. typedef gs_proc_known_encode((*gs_proc_known_encode_t));
  114.  
  115. /* Define the callback procedure vector for character to xglyph mapping. */
  116. typedef struct gx_xfont_callbacks_s {
  117.     gs_proc_glyph_name((*glyph_name));
  118.     gs_proc_known_encode((*known_encode));
  119. } gx_xfont_callbacks;
  120.  
  121. #endif /* gsccode_INCLUDED */
  122.